<template>
  <div v-html="showHtml"></div>
</template>

<script>
export default {
  name: 'MpdHtml',
  props: {
    htmlText: {
      type: String
    }
  },
  inject: ['selectPageNodeDom', 'mpdPageValue'],
  computed: {
    showHtml() {
      if (this.htmlText) {
        try {
          return eval('`' + this.htmlText + '`').replace(/undefined|null/g, '')
        } catch (error) {
          console.error('htmlText值转换错误（可以忽略）', error)
        }
      }
      return null
    }
  }
}
</script>
